<!--
 * @Author: HeAo
 * @Date: 2021-12-29 08:56:18
 * @LastEditTime: 2021-12-29 09:19:11
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \study\day04\1-vue入门.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>初识vue</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
  <div id="app">
    {{msg}}
    <h3>
      {{obj}}
    </h3>
    <div v-bind:title="title">{{title}}</div>
    <div :id="id"></div>
    <button v-on:click="toEditTitleHandler">修改title</button>
    <div v-html="html"></div>
  </div>
  <script>
    // 每个vue实例有且只能有一个根节点
    let vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello vue',
        obj: {
          name: 'zhangsan',
          age: 12
        },
        title: 'hello v-bind',
        id: 'first',
        html: `
          <p>我是P标签</p>
          <h1>我是h1标签</好>
          <h2>我是h2标签</好>
          <h3>我是h3标签</好>
        `
      },
      methods: {
        toEditTitleHandler() {
          this.title = 'bye vue'
        }
      }
    })
    // let obj = new Object()
    // let arr = new Array()
  </script>
</body>

</html>